﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Amazon_Book_Search.AmazonService;
using System.ServiceModel;
using Amazon_Book_Search.Models;

namespace Amazon_Book_Search.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/
        public ActionResult Index()
        {
            return View(new List<AmazonItem>());
        }
                
        public ActionResult Search(string q = "", int p = 1)
        {
            SearchPage page = new SearchPage(q, p);
            return View(page);
        }

        public PartialViewResult AjaxSearch(string q = "", int p = 1)
        {
            SearchPage page = new SearchPage(q, p);
            return PartialView("_SearchPartial", page);
        }

    }
}
